home *** CD-ROM | disk | FTP | other *** search
- /* Screen editor: terminal output module
- *
- * Module: ed6/ccc
- * Date: November 15, 1983
- * Changed: February 17, 1984
- */
-
- #include ed0
-
- /* data global to this module */
-
- /* Cursor location saves */
- char outx; /* column position */
- char outy; /* row position */
-
- /* Return the current coordinates of the cursor. */
- outgetx()
- { return(outx); }
-
- outgety()
- { return(outy); }
-
- /* Output one printable character to the screen. */
- outchar(c) char c;
- { if (c < ' ') {
- syscout(c);
- if (c == 8 && outx)
- --outx;
- else if (c == 13 | c == 10) {
- outx=0;
- ++outy;
- }
- }
- else if (outx < SCRNW1) {
- syscout(c);
- ++outx;
- }
- else {
- syscout(8);
- syscout(c);
- return(ERR);
- }
- return(c);
- }
-
- /* Position cursor to position x,y on screen.
- * 0,0 is the top left corner.
- */
- outxy(x,y) char x,y;
- { outx = x;
- outy = y;
- setcur(x,y);
- }
-
- /* Erase the entire screen.
- * Make sure the rightmost column is erased.
- */
- outclr()
- { outxy(0,0);
- syscout(0x1F);
- }
-
- /* Delete the line on which the cursor rests.
- * Leave the cursor at the left margin.
- */
- outdelln()
- { outxy(0,outy);
- outdeol();
- }
-
- /* Delete to end of line.
- * Assume the last column is blank.
- */
- outdeol()
- { syscout(0x1E); }
-
- /* Return yes if terminal has hardware scroll. */
- outhasup()
- { return(NO); }
-
- outhasdn()
- { return(NO); }
-
- /* Scroll the screen up.
- * Assume the cursor is on the bottom line.
- */
- outsup()
- {
- /* auto scroll */
- outxy(0,SCRNL1);
- syscout(10);
- }
-
- /* Scroll screen down.
- * Assume the cursor is on the top line.
- */
- outsdn()
- {
- /* auto scroll */
- outxy(0,0);
- syscout(11);
- }
-
- /* end module ed6/ccc */
-